/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.util.Util;
/*     */ import com.newcrm.webapi.sub.AddDeal;
/*     */ import com.newcrm.webapi.sub.ConfirmDestroyDeal;
/*     */ import com.newcrm.webapi.sub.DeleteDeal;
/*     */ import com.newcrm.webapi.sub.ExportDeals;
/*     */ import com.newcrm.webapi.sub.ListAllDeals;
/*     */ import com.newcrm.webapi.sub.ListDealExtInfo;
/*     */ import com.newcrm.webapi.sub.ListDeals;
/*     */ import com.newcrm.webapi.sub.SearchDealName;
/*     */ import com.newcrm.webapi.sub.ShowDeal;
/*     */ import com.newcrm.webapi.sub.ShowDealNote;
/*     */ import com.newcrm.webapi.sub.ShowNewDeal;
/*     */ import com.newcrm.webapi.sub.ShowUpdateDeal;
/*     */ import com.newcrm.webapi.sub.UpdateDeal;
/*     */ import com.newcrm.webapi.sub.UpdateDealNote;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class Deals extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = 1L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  47 */     if (!checkLogin(request)) {
/*  48 */       super.showLoginPage(request, response);
/*  49 */       return;
/*     */     }
/*  51 */     String url = request.getRequestURI();
/*  52 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try {
/*  54 */       String operation = Util.getURLParameter(request
/*  55 */         .getParameter("operation"));
/*  56 */       if (((param == null) || (param.length == 0)) && (
/*  57 */         (operation == null) || (operation.trim().length() == 0))) {
/*  58 */         new ListDeals(this).parse(request, response);
/*  59 */         return;
/*     */       }
/*     */ 
/*  62 */       if ((param != null) && (param.length == 3))
/*     */       {
/*  65 */         if ((param[1] != null) && (param[1].equals("background")) && 
/*  66 */           (param[2] != null) && 
/*  67 */           ("edit".equals(param[2]))) {
/*  68 */           if ((operation == null) || (operation.trim().length() == 0)) {
/*  69 */             new ShowDealNote(this, param[0]).parse(request, 
/*  70 */               response);
/*  71 */             return;
/*     */           }
/*     */ 
/*  74 */           if ("update".equals(operation)) {
/*  75 */             new UpdateDealNote(this, param[0]).parse(request, 
/*  76 */               response);
/*  77 */             return;
/*     */           }
/*     */         }
/*     */       }
/*  81 */       if ((param != null) && (param.length == 1))
/*     */       {
/*  84 */         if ("search".equals(param[0])) {
/*  85 */           new ListAllDeals(this).parse(request, response);
/*  86 */           return;
/*     */         }
/*     */ 
/*  90 */         if ("export".equals(param[0])) {
/*  91 */           new ExportDeals(this).parse(request, response);
/*  92 */           return;
/*     */         }
/*     */ 
/*  96 */         if ("name".equals(param[0])) {
/*  97 */           new SearchDealName(this).parse(request, response);
/*  98 */           return;
/*     */         }
/*     */ 
/* 102 */         if ("extInfo".equals(param[0])) {
/* 103 */           new ListDealExtInfo(this).parse(request, response);
/* 104 */           return;
/*     */         }
/*     */       }
/*     */     } catch (NotFoundException e) {
/* 108 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/* 109 */         request, response);
/* 110 */       return;
/*     */     }
/* 112 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/* 117 */     return new AddDeal(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/* 122 */     return new DeleteDeal(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/* 127 */     return new ListDeals(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 132 */     return new ShowDeal(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 137 */     return new ShowNewDeal(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 142 */     return new ConfirmDestroyDeal(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 147 */     return new ShowUpdateDeal(this, id);
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 152 */     return "/deals";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 157 */     return new UpdateDeal(this, id);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.Deals
 * JD-Core Version:    0.6.1
 */